<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="strutsTags"%>
<%@ taglib prefix="jscalendar" uri="/jscalendar"%>
<html>
	<head>
		<title>招聘报表</title>
		<script type="text/javascript">
		$(function() {
			$("#tabs").tabs();
		});
	</script>
		<style type="text/css">
#tabs-1,#tabs-2{
	background-color: #ECF6FB;
	border-top: 1px #6BB5DA solid;
}
</style>
	</head>
	<body>
		<s:component template="bodyhead">
			<s:param name="pagetitle" value="'招聘报表：'" />
			<s:param name="helpUrl" value="'37'" />
		</s:component>
		<div id="tabs">
			<ul>
				<li>
					<a href="#tabs-1" onclick="clearShow();">职位空缺分析</a>
				</li>
				<li>
					<a href="#tabs-2" onclick="clearShow();">应聘者分析</a>
				</li>
			</ul>
			<div id="tabs-1">
					<p/>
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
				
				<tr>
				<td align="right">部门:</td>
				<td>
			    <s:orgselector id="orgselector_select01"  name="departmentName" isShowPb="false" hiddenFieldName="departmentId" />
				</td>	
				<td align="right">招聘开始日期:</td>
				<td>
				<s:textfield  id="startDate_select01" name="startDate" required="true" size="10" maxlength="10"/>
				<img onclick="WdatePicker({el:'startDate_select01'})" class="dateimg" src="../resource/js/My97DatePicker/skin/datePicker.gif">
				</td>
				
				<td align="right">招聘结束日期:</td>
				<td>
				<s:textfield  id="endDate_select01" name="endDate" required="true" size="10" maxlength="10" onchange="if (!isComdate(document.getElementById('startDate_select01').value, document.getElementById('endDate_select01').value)){alert('招聘开始日期必须小于招聘结束日期!');document.getElementById('endDate_select01').value=''}" />
				<img onclick="WdatePicker({el:'endDate_select01'})" class="dateimg" src="../resource/js/My97DatePicker/skin/datePicker.gif">
				</td>
				<td class="prompt_div_bottom">				
					<input class="button" type="button" value="查看"
						onclick="display('select01','HTML');">
					<input class="button" type="button" value="PDF下载"
						onclick="display('select01','PDF');">
				</td>
			</tr>
		</table>			
		</div>
			<div id="tabs-2">
					<p/>
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td>
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
				<td align="right">组织单元:</td>
				<td>
			    <s:orgselector id="orgselector_select02"  name="departmentName" isShowPb="show" hiddenFieldName="departmentId"/>
				</td>
				<td align="right">招聘渠道:</td>
				<td>
					<s:select id ="recaChannelNo_select02" name="applier.recaChannelNo.id" list="RecruitchannelList" listKey="id" required="true" listValue="recchName" multiple="false" emptyOption="true" size="1"  />
				</td>
				<td align="right">招聘开始日期:</td>
				<td>
				<s:textfield  id="startDate_select02" name="startDate" required="true" size="10" maxlength="10"/>
				<img onclick="WdatePicker({el:'startDate_select02'})" class="dateimg" src="../resource/js/My97DatePicker/skin/datePicker.gif">
				</td>
				
				<td align="right">招聘结束日期:</td>
				<td>
				<s:textfield  id="endDate_select02" name="endDate" required="true" size="10" maxlength="10" onchange="if (!isComdate(document.getElementById('startDate_select02').value, document.getElementById('endDate_select02').value)){alert('招聘开始日期必须小于招聘结束日期!');document.getElementById('endDate_select02').value=''}" />
				<img onclick="WdatePicker({el:'endDate_select02'})" class="dateimg" src="../resource/js/My97DatePicker/skin/datePicker.gif">
				</td>
						</tr>
				</table>
				</td>
				<td class="prompt_div_bottom">				
					<input class="button" type="button" value="查看"
						onclick="display('select02','HTML');">
					<input class="button" type="button" value="PDF下载"
						onclick="display('select02','PDF');">
				</td>
			</tr>
		</table>	
				</div>
</div>
		<p>
			&nbsp;
		</p>
				<IFRAME ID="reportArea" name="reportArea" marginWidth="0"
					marginHeight="0" frameborder="0" align="left" width="100%"
					height="480" src="" style="overflow-y: auto;">
				</IFRAME>

	<script type="text/javascript">
	// 设定定时器
	var MyInterval;
				
	function viewReport(reportFileLocation,format,id){
		var baseReportURL = "../report/recruitmentReport.action";
        var baseEmployeeReportFolador = "/report/recruitment/";
        var resultURL = baseReportURL +"?reportFormat="+format+"&reportFileLocation="+baseEmployeeReportFolador+reportFileLocation;
		MyInterval=window.setInterval("hideDia()",500);
		$('#divWait').show();
		var temp_channel = $('#recaChannelNo_select02').select().val()
		if(id == 'select02')resultURL+="&channelId="+temp_channel;
       resultURL+="&newStartDate="+$('#startDate_'+id).val();
       resultURL+="&newEndDate="+$('#endDate_'+id).val();
       resultURL+="&departmentId="+$('#orgselector_returnString_orgselector_'+id).val();
        $("#reportArea").attr("src",resultURL);
    }
    function display(id,format){
        if(id == 'select01')reportFileLocation = 'recruitment_by_position.rptdesign';
        else if(id == 'select02')reportFileLocation = 'recruitment_by_applier.rptdesign';
        else return ;
        viewReport(reportFileLocation,format,id);
    }
    
    function hideDia(){
    	if($('#reportArea').contents().find('img')[0] != null || $('#reportArea').contents().find('div:last').text() != ""){
    		window.clearInterval(MyInterval);
    		$('#divWait').hide();
    	}
   	}
     
	//清楚页面中reportArea的内容。
	function clearShow(){
	 	 $("#reportArea").attr("src",'');
	}
</script>
<jsp:include page="../../sitemesh/div_wait.jsp" flush="true"></jsp:include>
</body>
</html>
